Skip to content

fix incomplete removal of datetime_taken in PR #653#663

Merged
wpferguson merged 3 commits intodarktable-org:masterfrom
deekayhd:issue_661
Apr 11, 2026
Merged

fix incomplete removal of datetime_taken in PR #653#663
wpferguson merged 3 commits intodarktable-org:masterfrom
deekayhd:issue_661

Conversation

@deekayhd
Copy link
Copy Markdown
Contributor

Fixes a bug introduced with PR #653. Variable datetime_taken in string.lua, lines 788 and 792 is not used anymore and therefore not initialized correctly.

close #661.

@wpferguson
Copy link
Copy Markdown
Member

Fixes darktable-org/darktable#20787

@fabiangebert
Copy link
Copy Markdown

I've checked it out locally and can confirm the rename op working again. Thank you!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. emon_long gets "" and everything else gets nil

Should be

emon_long, emon_short, eyear, emon, eday, ehour, emin, esec, emsec = "", "", "", "", "", "", "", "", ""

Copy link
Copy Markdown
Contributor Author

@deekayhd deekayhd Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. I swear I tested it, and fortunately, this did not cause a runtime error, because there is a check in lines 1083 to 1091.
But, of course, it is safer to initialize it properly.
fixed,

@wpferguson
Copy link
Copy Markdown
Member

@deekayhd here's a test script,
test_date_time_substitution.zip

Start darktable, start the script, and assign a shortcut to it. In a collection hit the shortcut and it will build a substitution string on EXIF.MONTH.LONG for the first 10 images. The 11th will get an empty date time. What the script will do is set debug logging on it the string library and spit out a list of all the variable substitutions (which is how I found the nil instead of "" in the e... variables.

@deekayhd
Copy link
Copy Markdown
Contributor Author

Thanks for your thorough testing. With the script, I found that $(USERNAME) could come out as nil, as well, if not provided in the call of method substitute(). Fixed that, too.

@wpferguson
Copy link
Copy Markdown
Member

Looks good to me. Thanks

@wpferguson wpferguson merged commit a55de74 into darktable-org:master Apr 11, 2026
@deekayhd deekayhd deleted the issue_661 branch April 11, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename image script fails when calling build_substitute_list

3 participants